<?php /* Smarty version 2.6.20, created on 2016-07-19 15:22:43
         compiled from after_sale.htm */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', 'after_sale.htm', 79, false),array('modifier', 'date_format', 'after_sale.htm', 79, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>订单管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../script/jquery-1.4.4.min.js"></script>
<script language="javascript" src="../script/Calendar.js"></script>
</head>
<body>
<div class="container">
    <div class="flow">
        <div class="itemtitle">
            <h3>售后管理</h3>
            <ul>
                <li <?php if ($_GET['status'] == ''): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
"><span>管理</span></a></li>
                <?php $_from = $this->_tpl_vars['after_sale_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['num'] => $this->_tpl_vars['list']):
?>
                <li <?php if ($_GET['status'] == $this->_tpl_vars['num']): ?>class="current"<?php endif; ?>><a href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&status=<?php echo $this->_tpl_vars['num']; ?>
"><span><?php echo $this->_tpl_vars['list']; ?>
</span></a></li>
                <?php endforeach; endif; unset($_from); ?>
            </ul>
        </div>
    </div>
    <div class="h35"></div>
    <table class="select_table">
        <tr>    
            <td>
                <div class="select_box">
                <form action="" method="get">
                    <input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
                    <input type="hidden" name="s" value="after_sale.php">
                    <input type="hidden" name="status" value="<?php echo $_GET['status']; ?>
">
                    <input placeholder="请输入订单编号..." type="text" name="code" class="txt w250" value="<?php echo $_GET['code']; ?>
" />
                    <input type="submit" value="搜索" />
                </form>
                </div>
                <div class="search">
                    <a class="a-search" href="#">高级搜索</a>
                    <div class="div-search">
                        <div class="close"></div>
                        <div class="line"></div>
                        <div class="search-con clearfix">
                        <form action="" method="get">
                        <input type="hidden" name="m" value="<?php echo $_GET['m']; ?>
">
                        <input type="hidden" name="s" value="after_sale.php">
                        <input type="hidden" name="status" value="<?php echo $_GET['status']; ?>
">
                        <dl>
                            <dt>订单编号</dt>
                            <dd><input type="text" class="w250" name="code" value="<?php echo $_GET['code']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>商品SKU_ID</dt>
                            <dd><input type="text" class="w250" name="product_id" value="<?php echo $_GET['product_id']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>商品名称</dt>
                            <dd><input type="text" class="w250" name="product_name" value="<?php echo $_GET['product_name']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>状态</dt>
                            <dd>
                            <select name="after_sale_status" class="w250">
                            <option value="">请选择</option>
                            <?php $_from = $this->_tpl_vars['after_sale_status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['list']):
?>
                            <option <?php if ($_GET['after_sale_status'] == $this->_tpl_vars['key']): ?>selected="selected"<?php endif; ?> value="<?php echo $this->_tpl_vars['key']; ?>
"><?php echo $this->_tpl_vars['list']; ?>
</option>
                            <?php endforeach; endif; unset($_from); ?>
                            </select>
                            </dd>
                        </dl>
                        <dl>
                            <dt>申请时间</dt>
                            <dd>
                            <script language="javascript">
            var cdr = new Calendar("cdr");
            document.write(cdr);
            cdr.showMoreDay = true;
        </script>
                            <input onFocus="cdr.show(this);" class="w118" type="text" name="stime" id="stime" value="<?php echo $_GET['stime']; ?>
"">
                            -
                            <input onFocus="cdr.show(this);" class="w118" type="text" name="etime" id="etime" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['etime'])) ? $this->_run_mod_handler('default', true, $_tmp, time()+86399) : smarty_modifier_default($_tmp, time()+86399)))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"">
                            </dd>
                        </dl>
                        <dl>
                            <dt>会员名</dt>
                            <dd><input type="text" class="w250" name="user" value="<?php echo $_GET['user']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>联系人</dt>
                            <dd><input type="text" class="w250" name="contact_person" value="<?php echo $_GET['contact_person']; ?>
" /></dd>
                        </dl>
                        <dl>
                            <dt>联系电话</dt>
                            <dd><input type="text" class="w250" name="contact_mobile" value="<?php echo $_GET['contact_mobile']; ?>
" /></dd>
                        </dl>
                        <input type="submit" value="搜索" />
                        </form>
                        </div>
                    </div>
                </div>
                <a class="refresh" href="?m=<?php echo $_GET['m']; ?>
&s=<?php echo $_GET['s']; ?>
&status=<?php echo $_GET['status']; ?>
"></a>
           </td>
        </tr>
    </table>
    <table class="table product">
       <tbody>
       <tr class="header">
            <th width="40">查看</th>
            <th width="60">操作</th>
            <th class="al">订单编号</th>
            <th width="150">用户名</th>
            <th width="150">商品名称</th>
            <th width="150">商品数量</th>
            <th width="150">申请理由</th>
            <th width="150">联系人</th>
            <th width="150">联系电话</th>
            <th width="100">申请时间</th>
            <th width="130">状态</th>
        </tr>
        <?php $_from = $this->_tpl_vars['de']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['list']):
?>
        <tr class="<?php if ($this->_tpl_vars['list']['status'] == 1): ?>bold<?php endif; ?>">
            <td><a href="?m=product&s=after_sale_detail.php&id=<?php echo $this->_tpl_vars['list']['id']; ?>
">查看</a></td>
            <td>
            <?php if ($this->_tpl_vars['list']['status'] != -1 && $this->_tpl_vars['list']['status'] != 9): ?>
            <div class="operate">
                <a class="opear" href="#">操作<i></i></a>
                <ul>
<?php if ($this->_tpl_vars['list']['status'] == 1): ?>
<li><a class="a-opear" data-type="pass" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">审核通过</a></li>
<li><a class="a-opear" data-type="not_pass" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">不通过</a></li>
<?php endif; ?>
<?php if ($this->_tpl_vars['list']['status'] == 3): ?>
<li><a class="a-opear" data-type="recieved" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">已收货</a></li>
<?php endif; ?>
<?php if ($this->_tpl_vars['list']['status'] == 4): ?>
<li><a class="a-opear" data-type="check_yes" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">验收通过</a></li>
<li><a class="a-opear" data-type="check_no" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">验收失败</a></li>
<?php endif; ?>
<?php if ($this->_tpl_vars['list']['status'] == 5): ?>
<li><a class="a-opear" data-type="complete" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">完成</a></li>
<?php endif; ?>
<li><a class="a-opear" data-type="cancel" data-param="{'id':'<?php echo $this->_tpl_vars['list']['id']; ?>
'}" href="#">取消</a></li>
                </ul>
            </div>
            <?php elseif ($this->_tpl_vars['list']['status'] == 9): ?>
            已完成
            <?php else: ?>
            已取消
            <?php endif; ?>
            </td>
            <td class="al"><?php echo $this->_tpl_vars['list']['order_id']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['user_nick_name']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['product_name']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['num']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['description']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['contact_person']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['contact_mobile']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['create_time']; ?>
</td>
            <td><?php echo $this->_tpl_vars['list']['status_name']; ?>
</td>
        </tr>
        <?php endforeach; else: ?>
        <tr>
            <td class="norecord" colspan="99"><i></i><span>暂无符合条件的数据记录</span></td>
        </tr>
        <?php endif; unset($_from); ?>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="99">
                    <div class="fl">每页最多显示： 20条</div>
                    <div class="page"><?php echo $this->_tpl_vars['de']['page']; ?>
</div>
                    <div class="fr">共有<?php echo $this->_tpl_vars['de']['count']; ?>
条记录</div>
                </td>
            </tr>
        </tfoot>
    </table>
<script>
$(".a-opear").live('click',function(){
    
    var data = $(this).attr('data-param');
    eval("data = "+data);
    var type = $(this).attr('data-type');
    if(!data.id)
    {
        error('error','对不起，请选择订单后操作！');
        return false;
    }
    
    window.parent.ajax_form("after_sale", "操作售后申请", '<?php echo $this->_tpl_vars['config']['weburl']; ?>
/admin/module.php?m=product&s=after_sale.php&type='+type+'&id='+data.id, 800);
    return false;
    
});
$('.operate').hover(function(){                  
    if ($(this).position().top + $(this).children("ul").height() + $(this).parent("td").height() - $(window).height()- $(window).scrollTop()  < 0) {
        $(this).addClass("hover");
        $(this).children("ul").css("top", "22px");
    } else {
        $(this).addClass("hover-up");
        $(this).children("ul").css("top", -$(this).children("ul").height());
    }
},function(){
    $(this).removeClass("hover").removeClass("hover-up");   
});
$('.search').bind("mouseenter", function (e) {
    $(this).addClass("hover");
}).bind("mouseleave", function (e) {
    //$(this).removeClass("hover");
});
$('.close').bind("click", function (e) {
    $(this).parent().parent().removeClass("hover");
}) 
$('#stime').click(function () {
    var left = $("#Calendar").css("left");
    left = left.substring(0,left.length-2);
    left = left - 359;
    left = left+"px";
    var top = $("#Calendar").css("top");
    top = top.substring(0,top.length-2);
    top = top - 90;
    top = top+"px";
    $("#Calendar").css("left",left);
    $("#Calendar").css("top",top);
}) 
$('#etime').click(function () {
    var left = $("#Calendar").css("left");
    left = left.substring(0,left.length-2);
    left = left - 359;
    left = left+"px";
    var top = $("#Calendar").css("top");
    top = top.substring(0,top.length-2);
    top = top - 90;
    top = top+"px";
    $("#Calendar").css("left",left);
    $("#Calendar").css("top",top);
}) 
</script>    
</div>
</body>
</html>